package com.health.memberbackstage.web;

import com.health.memberbackstage.pojo.Checkgroup;
import com.health.memberbackstage.pojo.R.Result;
import com.health.memberbackstage.pojo.ReportDetail;
import com.health.memberbackstage.service.ReportDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/reportDetail")
public class ReportDetailController {

    @Autowired
    private ReportDetailService reportDetailService;

    @GetMapping("/{fileNumber}")
    private Result findReportDetail(@PathVariable("fileNumber") Long fileNumber){
        List<Checkgroup> checkgroups = reportDetailService.findByFileNumber(fileNumber);
        if (checkgroups != null){
            return Result.success(checkgroups);
        }
        return Result.fail("查询失败");
    }
}
